/**
 * @(#)Test1t (c) 2014-2018 一抹风光
 *
 * DESC:
 *
 */
package com.pattern.p_01_strategy.demo2;


/**
 * @author fusf
 * @version 1.0  2016/10/23
 */
public class Test1 {

    public static void main(String[] args) {
       Duck greenDuck = new GreeDuck();
        greenDuck.display();
       // greenDuck.quack();
        greenDuck.fly();

        Duck redDuck = new RedDuck();
        redDuck.display();
        redDuck.quack();
        redDuck.fly();

        greenDuck.setFlyBehavior(new GoodFlyBehavior());
        greenDuck.fly();

    }
}
